GtkButton: warn slightly less
authorMatthias Clasen <mclasen@redhat.com>
Sat, 28 Jun 2014 14:56:54 +0000 (10:56 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 28 Jun 2014 14:56:54 +0000 (10:56 -0400)
Use gtk_misc_set_alignment when setting x/align on button children
where possible, to avoid the runtime warning that g_object_set
incurs nowadays.

gtk/gtkbutton.c

index 77143f241bf137ebb3e8e2fe2765da94f8fed985..5a9e4e9aca3037450f80ab5f8019a96cbe7f447e 100644 (file)
@@ -702,7 +702,9 @@ maybe_set_alignment (GtkButton *button,
     return;
 
 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-  if (GTK_IS_MISC (widget) || GTK_IS_ALIGNMENT (widget))
+  if (GTK_IS_MISC (widget))
+    gtk_misc_set_alignment (GTK_MISC (widget), priv->xalign, priv->yalign);
+  else if (GTK_IS_ALIGNMENT (widget))
     g_object_set (widget, "xalign", priv->xalign, "yalign", priv->yalign, NULL);
 G_GNUC_END_IGNORE_DEPRECATIONS
 }